home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 11681 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.0 KB

  1. Path: news.mindspring.com!usenet
  2. From: rudd@mindspring.com (Justin Rudd)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Accessing base methods?
  5. Date: Fri, 15 Mar 1996 17:48:52 GMT
  6. Organization: MindSpring Enterprises
  7. Message-ID: <4icajt$lj6@B1FF.mindspring.com>
  8. References: <RobTerrell-1503961232280001@slip129-37-240-94.nc.us.ibm.net>
  9. Reply-To: rudd@mindspring.com
  10. NNTP-Posting-Host: rudd.mindspring.com
  11. X-Newsreader: Forte Free Agent v0.55
  12.  
  13. RobTerrell@vmedia.com (Rob Terrell) wrote:
  14.  
  15.  
  16. >I'm just coming back to C++ after a 6-year absence...and I'm trying to
  17. >figure out how to access the base methods of a derived class.
  18.  
  19. Welcome back :-)
  20.  
  21. >Take this class:
  22.  
  23. OK...but where do you want me to take it???
  24.  
  25. Heheheh...sorry couldn't resist...been watching Laurel and Hardy all
  26. morning :-)
  27.  
  28. >class base {
  29.  
  30. >   virtual void Move();
  31. >}
  32.  
  33. >class derived : public base {
  34.  
  35. >   void Move();
  36. >}
  37.  
  38.  
  39. >Okay, so when I'm in the method....
  40.  
  41.  
  42. >void derived::Move()
  43. >{
  44.  
  45. > // do stuff here
  46.  
  47. > // Now I want to call the base class' Move
  48.  
  49.   //Try this
  50.   base::Move();
  51.   ^^^^^^^^^^^
  52.  
  53. >}
  54.  
  55. [snip]
  56.  
  57. Justin
  58.  
  59.